package com.deplume.ssm.service.impl.admin;

import com.deplume.ssm.common.Page;
import com.deplume.ssm.mapper.admin.ICustomerRelativeMapper;
import com.deplume.ssm.pojo.admin.Advertise;
import com.deplume.ssm.pojo.admin.Customer;
import com.deplume.ssm.pojo.extra.ChangeStatus;
import com.deplume.ssm.service.inface.admin.ICustomerRelativeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by blake on 2016/7/28.
 */
@Service("customerRelativeService")
public class CustomerRelativeServiceImpl implements ICustomerRelativeService {

    @Autowired
    ICustomerRelativeMapper customerRelativeMapper;

    @Override
    public List<Customer> returnCustomerInfos(Page page) throws Exception
    {

        return customerRelativeMapper.returnCustomerInfos(page);
    }

    @Override
    public Customer returnCustomerInfo(int id) throws Exception
    {

        return customerRelativeMapper.returnCustomerInfo(id);
    }

    @Override
    public List<Customer> findCustomerByName(Page page) throws Exception
    {

        return customerRelativeMapper.findCustomerByName(page);
    }

    @Override
    public void changeCustomerStatus(ChangeStatus changeStatus) throws Exception
    {

        customerRelativeMapper.changeCustomerStatus(changeStatus);
    }

    @Override
    public void deleteCustomerById(int id) throws Exception
    {

        customerRelativeMapper.deleteCustomerById(id);
    }

    @Override
    public void updateCustomerInfo(Customer customer) throws Exception
    {
        customerRelativeMapper.updateCustomerInfo(customer);
    }

    @Override
    public List<Advertise> returnAllAdvertisement(Page page) throws Exception
    {
        return customerRelativeMapper.returnAllAdvertisement(page);
    }

    @Override
    public List<Advertise> findAdvertisementByName(Page page) throws Exception
    {
        return customerRelativeMapper.findAdvertisementByName(page);
    }

    @Override
    public void updateAdvertisementById(Advertise advertise) throws Exception
    {
        customerRelativeMapper.updateAdvertisementById(advertise);
    }

    @Override
    public void insertAdvertisement(Advertise advertise) throws Exception
    {
        customerRelativeMapper.insertAdvertisement(advertise);
    }

    @Override
    public void deleteAdvertisementById(int id) throws Exception
    {
        customerRelativeMapper.deleteAdvertisementById(id);
    }

    @Override
    public void changeAdvertisementStatus(ChangeStatus changeStatus) throws
            Exception
    {
        customerRelativeMapper.changeAdvertisementStatus(changeStatus);
    }

}
